import request from '@/utils/request'
// 商品数据
export function goodsList(params) {
  return request({
    url: '/jd/good/cate',
    method: 'get',
    params
  })
}

// 商品分类列表
export const getCate = () => {
  return request({
    url: '/jd/list',
    method: 'get'
  })
}

// 删除商品
export const fetchDelShop = (params) => {
  return request({
    url: '/jd/delshop',
    method: 'get',
    params
  })
}

// 添加商品
const fetchAddShop = (data) => {
  return request({
    url: '/jd/addshop',
    method: 'post',
    data
  })
}

// 查询编辑商品
const fetchSearchShop = (data) => {
  return request({
    url: '/jd/searchShop',
    method: 'post',
    data
  })
}

// 修改商品
const fetchEditShop = (data) => {
  return request({
    url: '/jd/editShop',
    method: 'post',
    data
  })
}

// 获取商品订单
const fetchShopOrder = (data) => {
  return request({
    url: '/jd/order',
    method: 'post',
    data
  })
}

// 删除商品订单
const fetchDelOrder = (params) => {
  return request({
    url: '/jd/order/del',
    method: 'get',
    params
  })
}
// banner

const fetchGetBanner = (data) => {
  return request({
    url: 'jd/get/banner',
    method: 'post',
    data
  })
}
const fetchSetBanner = (params) => {
  return request({
    url: 'jd/set/banner',
    method: 'get',
    params
  })
}
const fetchaddBanner = (data) => {
  return request({
    url: 'jd/add/banner',
    method: 'post',
    data
  })
}

const fetchDelBanner = (params) => {
  return request({
    url: 'jd/del/banner',
    method: 'get',
    params
  })
}

export default {
  goodsList,
  getCate,
  fetchDelShop,
  fetchAddShop,
  fetchSearchShop,
  fetchEditShop,
  fetchShopOrder,
  fetchDelOrder,
  fetchSetBanner,
  fetchaddBanner,
  fetchGetBanner,
  fetchDelBanner
}
